Repository navigation
Phase 3b: Integrate Tauri viewer into CLI and add legacy-browser fallback - #36
Merged
Merged
Conversation
When --app is passed and the fastled-viewer binary is found (sibling of
the running exe, cargo target/{debug,release}/, or PATH), the Rust CLI
now drives the build-then-view flow directly:
1. Python is invoked with --just-compile (no browser).
2. fastled-viewer is spawned pointing at <sketch>/fastled_js.
3. If the viewer cannot be launched, automatically falls back to the
full Python Flask+Playwright path.
Add --legacy-browser flag to force the old Flask+browser behaviour even
when the native viewer is available.
Expose viewer_available() in the PyO3 bridge (fastled-py/_native) so
Python callers can query viewer presence.
No Python files were modified; Flask, Playwright, and all existing
dependencies are untouched.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
crates/fastled-cli/src/viewer.rswithfind_tauri_viewer()(checks sibling exe dir,target/debug/,target/release/, PATH) andlaunch_tauri_viewer()that spawns thefastled-viewerbinary.main.rs: when--appis passed and the Tauri viewer is found, Python is invoked with--just-compileonly, then the Rust process launches and waits for the native viewer. If the viewer launch fails, falls back automatically to the legacy Flask+Playwright path.--legacy-browserCLI flag to force the old Flask+browser behaviour even when the native viewer is available.viewer_available() -> boolin the PyO3 bridge (fastled-py/_native) so Python callers can introspect viewer presence.Closes #24
Test plan
./_cargo build --workspace— compiles cleanly./_cargo test --workspace— 47 Rust tests pass (3 new viewer tests)./_cargo clippy --workspace --all-targets -- -D warnings— clean./_cargo fmt --all --check— cleanbash lint— ruff/black/isort/pyright all passbash test— all 121 Python tests passfastled <sketch> --appwith viewer binary present launches native viewerfastled <sketch> --app --legacy-browserskips viewer and opens Flask+browserfastled <sketch> --appwithout viewer binary falls back to Flask+browser silently